#include "RecoderManager.h"
#include "x_wr_asio.h"
#include "RecodeMediaObj.h"

CRecoderManager::CRecoderManager()
{
    m_fds = 1000;
}

CRecoderManager::~CRecoderManager()
{

}

int CRecoderManager::OnWrite(int nfd)
{
    return J_OK;
}

int CRecoderManager::StartService()
{
    CWrAsio::Instance()->Init();
    return J_OK;
}

int CRecoderManager::StopService()
{
    CWrAsio::Instance()->Deinit();
    return J_OK;
}

int CRecoderManager::StartRecode(const char *pResid)
{
    MediaMap::iterator it = m_mediaMap.find(pResid);
    if (it == m_mediaMap.end())
    {
        J_MediaObj *mediaObj = new CRecodeMedia();
        assert(mediaObj != NULL);
        m_mediaMap[pResid] = mediaObj;
    }
    return J_OK;
}

int StopRecode(const char *pResid)
{
    return J_OK;
}
